#include <iostream>

using namespace std;

int main() {
    int L;
    int load = 0; //袋子容量
    int count = 0; //质数个数
    cin >> L;
    for (int i = 2;; i++) {
        int prime = 1;
        for (int j = 2; j * j <= i; j++)
            if (i % j == 0) {
                prime = 0;
                break;
            }
            if (!prime)
                continue;
            if (i + load > L)
                break;
            cout << i << endl;
            count++;
            load += i;
        }

    cout << count;


    return 0;
}
